package com.qf.utils;

import java.math.BigInteger;
import java.security.MessageDigest;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/8/16 11:40
 */
public class MD5Utils {
    public static String md5(String str){
        try {
            MessageDigest md5 = MessageDigest.getInstance("md5");
            byte[] bytes=str.getBytes("utf-8");
            for (int i = 0; i < bytes.length; i++) {
                bytes[i]+=5;
            }
            md5.update(bytes);
            byte[] digest = md5.digest();
            return new BigInteger(1,digest).toString(16);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
